import re
def judgesize(cup):
    par = re.compile("[ABCDEFGabcdefg]{1}")
    if len(par.findall(cup))!=0:
        flag = str(par.findall(cup)[0]).upper()
        if flag =='A':
            return 1
        if flag =='B':
            return 2
        if flag =='C':
            return 3
        if flag =='D':
            return 4
        if flag =='E':
            return 5
        if flag =='F':
            return 6
        if flag =='G':
            return 7
    else:
        return 0

if __name__ == '__main__':
    print(judgesize("79b"))